﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using WebStudio.Mvc.Core.Helper;

namespace WebStudio.Mvc.Core
{
    /// <summary>
    /// 视图类
    /// 继承于ViewPage
    /// </summary>
    public class XViewPage: ViewPage
    {
        #region XHtmlHelper
        /// <summary>
        /// XHtmlHelper
        /// </summary>
        private XHtmlHelper _XHtml;

        /// <summary>
        /// XHtmlHelper
        /// </summary>
        public XHtmlHelper XHtml
        {
            get
            {
                if (this._XHtml == null)
                {
                    this._XHtml = new XHtmlHelper(this.ViewContext, this);
                }
                return this._XHtml;
            }
        } 
        #endregion
    }

    /// <summary>
    /// 视图类
    /// 继承于ViewPage
    /// </summary>
    /// <typeparam name="TModel"></typeparam>
    public class XViewPage<TModel> : ViewPage<TModel>
    {
        #region XHtmlHelper
        /// <summary>
        /// XHtmlHelper
        /// </summary>
        private XHtmlHelper _XHtml;

        /// <summary>
        /// XHtmlHelper
        /// </summary>
        public XHtmlHelper XHtml
        {
            get
            {
                if (this._XHtml == null)
                {
                    this._XHtml = new XHtmlHelper(this.ViewContext, this);
                }
                return this._XHtml;
            }
        }
        #endregion
    }

}
